Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented May 11, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

Releases

[email protected]

Major Changes

  • #76 51828ad Thanks @typicalninja! - Replace Axios with native Fetch API

    Replace Axios HTTP client with native fetch API to reduce external dependencies and improve compatibility across environments.

    Breaking Change: The requestConfig option now accepts the RequestOptions interface (extending RequestInit) instead of AxiosRequestConfig.

    import { search } from "google-sr";
    
    search({
      requestConfig: {
    -   params: {
    +   queryParams: {
          safe: "active",
          gl: "us",
        },
        headers: {
          "Some-Header": "value",
        },
      },
    })
  • #79 ae54adf Thanks @typicalninja! - Rename CurrencyResult to UnitConversionResult

    Rename CurrencyResult to UnitConversionResult to better reflect its ability to handle all conversion queries (currency, units, measurements, etc.), not just currency conversions.

    Breaking Changes:

    • CurrencyResultUnitConversionResult
    • CurrencyResultNodeUnitConversionResultNode
    • ResultTypes.CurrencyResultResultTypes.UnitConversionResult
    - import { CurrencyResult, CurrencyResultNode } from 'google-sr';
    + import { UnitConversionResult, UnitConversionResultNode } from 'google-sr';
    
    const results = search({
      query: "100 USD to EUR",
    -  parsers: [CurrencyResult]
    +  parsers: [UnitConversionResult]
    });
    
    - if (result.type === ResultTypes.CurrencyResult) {
    + if (result.type === ResultTypes.UnitConversionResult) {
      // handle unit conversion result
    }
  • #80 592ea47 Thanks @typicalninja! - Remove strictSelector in favor of noPartialResults

    Replace strictSelector option with noPartialResults for improved clarity and better description of its behavior.

    search({
    - strictSelector: true,
    + noPartialResults: true,
    });
  • #92 2722f6d Thanks @typicalninja! - Fixed types and improved all result parsers

    Fixed generic types for partial results. Now search and searchWithPages return the correct types based on the noPartialResults option.

    Breaking Changes:

    • DictionaryResultNode interface: phonetic and word properties are now required when noPartialResults is true. This makes all result types consistent.
      • DictionaryResultNode now has the proper type property.
    • All parsers now convert empty strings to undefined (this was in the types but not working). This may break your code if you expected empty strings in the previous versions.

    Other Changes:

    • Refactored all internal parsers for better consistency
    • Added better documentation and examples
    • Improved parsing reliability
  • #93 4ac1402 Thanks @typicalninja! - Make OrganicResult description field optional

    The description field in OrganicResultNode is now optional (string | undefined) to handle cases where search results don't include a description. This is a breaking change as existing code may need to be updated to handle the undefined case.

  • #73 f462148 Thanks @typicalninja! - Remove ResultNodeTyper type helper

    ResultNodeTyper was a helper type that was used to define the type returned by a parser. This was removed, as it can be replaced with a simple interface definition.

    - import { ResultNodeTyper } from 'google-sr';
    - type MyCustomNode = ResultNodeTyper<"CUSTOM", 'link' | 'title'>;
    
    + interface MyCustomNode {
    +    type: "CUSTOM";
    +    link: string;
    +    title: string;
    + }
  • #85 85bae81 Thanks @typicalninja! - Rename ResultSelector to ResultParser and resultTypes to parsers

    The API has been updated to use more intuitive naming that eliminates confusion between CSS selectors and result parser functions.

    Breaking Changes:

    • ResultSelector type renamed to ResultParser
    • resultTypes option renamed to parsers in search functions

    Migration Guide:

    import { search, OrganicResult } from "google-sr";
    
    const results = await search({
      query: "hello world",
    - resultTypes: [OrganicResult],
    + parsers: [OrganicResult],
    });

Minor Changes

  • #71 cae9f30 Thanks @tresorama! - Add NewsResult for parsing Google News tab results

    Add NewsResult parser for Google News tab search results. Requires setting tbm: 'nws' in requestConfig and is incompatible with other parsers.

    import { NewsResult, search } from "google-sr";
    
    const results = await search({
      query: "latest news",
      parsers: [NewsResult],
      requestConfig: {
        queryParams: {
          tbm: "nws", // Required for news results
        },
      },
    });
  • #89 bb1cc1a Thanks @typicalninja! - Add thumbnail image to news parser & selector

  • #90 352ba4c Thanks @typicalninja! - Add metadata properties to OrganicSearch parser

    The parser now returns an OrganicResultNode with the following new properties:

    • source: The source of the result, usually a human friendly version of the URL.
    • isAd: boolean indicating if the result is an ad.
    export interface OrganicResultNode extends SearchResultNodeLike {
    	type: typeof ResultTypes.OrganicResult;
    +	source: string;
    +	isAd: boolean;
    }
  • #94 6c08082 Thanks @typicalninja! - Migrate packages to ESM-first with CJS compatibility via dual build

    All packages have been migrated from CJS-first to ESM-first architecture. Existing users can continue using the packages without any code changes as both ESM and CJS builds are provided.

  • #96 51580a6 Thanks @typicalninja! - Add RelatedSearchesResult parser for extracting related search queries

    Add RelatedSearchesResult parser to extract the "Related searches" suggestions that Google displays at the bottom of search results to help users find similar queries.

    import { RelatedSearchesResult, search } from "google-sr";
    
    const results = await search({
      query: "nodejs frameworks",
      parsers: [RelatedSearchesResult],
    });
    
    // results[0].queries might contain: ["express.js", "react.js", "vue.js", ...]

    The parser returns a RelatedSearchesResultNode with:

    • type: "RELATED_SEARCHES"
    • queries: Array of related search query strings

Patch Changes

  • #98 33993c9 Thanks @typicalninja! - Fix delay option in searchWithPages function

    The delay option was previously defined in SearchOptionsWithPages interface but was not actually implemented in the searchWithPages function. This fix adds the missing delay functionality that applies the specified delay (default 1000ms) between page requests, helping to prevent rate limiting.

  • #83 52d4ed8 Thanks @typicalninja! - Optimize parser performance by checking for empty data earlier when noPartialResults is enabled

  • #65 fe575b5 Thanks @typicalninja! - Update dependencies to latest versions

  • Updated dependencies [352ba4c, cae9f30, bb1cc1a, 786a8fc, 51580a6, 6c08082]:

[email protected]

Major Changes

  • 786a8fc Thanks @typicalninja! - Rename CurrencyConvertSelector to UnitConversionSelector

    Rename CurrencyConvertSelector to UnitConversionSelector to better reflect its ability to handle all conversion queries (currency, units, measurements, etc.), not just currency conversions.

    Breaking Changes:

    • CurrencyConvertSelectorUnitConversionSelector
    - import { CurrencyConvertSelector } from 'google-sr-selectors';
    + import { UnitConversionSelector } from 'google-sr-selectors';

Minor Changes

  • #90 352ba4c Thanks @typicalninja! - Add metadata selectors to OrganicSearchSelector

    This release adds new CSS selectors for extracting metadata from Google search results:

    The metaSource and metaAd selectors are nested within the metaContainer element.

    const OrganicSearchSelector = {
      metaContainer: "span.qXLe6d.dXDvrc",
      metaSource: "span.fYyStc:last-of-type",
      metaAd: "span.dloBPe.fYyStc",
    };
  • #71 cae9f30 Thanks @tresorama! - Add NewsResult for parsing Google News tab results

    Add NewsResult parser for Google News tab search results. Requires setting tbm: 'nws' in requestConfig and is incompatible with other parsers.

    import { NewsResult, search } from "google-sr";
    
    const results = await search({
      query: "latest news",
      parsers: [NewsResult],
      requestConfig: {
        queryParams: {
          tbm: "nws", // Required for news results
        },
      },
    });
  • #89 bb1cc1a Thanks @typicalninja! - Add thumbnail image to news parser & selector

  • #96 51580a6 Thanks @typicalninja! - Add RelatedSearchesSelector for parsing related search queries

    Add new CSS selectors for extracting related search suggestions that appear at the bottom of Google search results.

  • #94 6c08082 Thanks @typicalninja! - Migrate packages to ESM-first with CJS compatibility via dual build

    All packages have been migrated from CJS-first to ESM-first architecture. Existing users can continue using the packages without any code changes as both ESM and CJS builds are provided.

[email protected]

Major Changes

  • #85 85bae81 Thanks @typicalninja! - Update CLI to use renamed parser API

    The CLI now uses the new parsers option and ResultParser type from google-sr instead of the old resultTypes and ResultSelector names.

    Breaking Change:

    • The CLI option --resultTypes/-r is now --parsers/-r to match the new API.

Minor Changes

  • #79 ae54adf Thanks @typicalninja! - Rename CurrencyResult to UnitConversionResult

    Rename CurrencyResult to UnitConversionResult to better reflect its ability to handle all conversion queries (currency, units, measurements, etc.), not just currency conversions.

    Breaking Changes:

    • CurrencyResultUnitConversionResult
    • CurrencyResultNodeUnitConversionResultNode
    • ResultTypes.CurrencyResultResultTypes.UnitConversionResult
    - import { CurrencyResult, CurrencyResultNode } from 'google-sr';
    + import { UnitConversionResult, UnitConversionResultNode } from 'google-sr';
    
    const results = search({
      query: "100 USD to EUR",
    -  parsers: [CurrencyResult]
    +  parsers: [UnitConversionResult]
    });
    
    - if (result.type === ResultTypes.CurrencyResult) {
    + if (result.type === ResultTypes.UnitConversionResult) {
      // handle unit conversion result
    }
  • #94 6c08082 Thanks @typicalninja! - Migrate packages to ESM-first with CJS compatibility via dual build

    All packages have been migrated from CJS-first to ESM-first architecture. Existing users can continue using the packages without any code changes as both ESM and CJS builds are provided.

Patch Changes

@github-actions github-actions bot force-pushed the changeset-release/master branch 4 times, most recently from 5ed4f2a to 97303ab Compare June 1, 2025 12:32
@typicalninja typicalninja added this to the V6 Release milestone Jun 1, 2025
@github-actions github-actions bot force-pushed the changeset-release/master branch 2 times, most recently from 647a7a8 to bf66700 Compare June 7, 2025 14:51
@github-actions github-actions bot force-pushed the changeset-release/master branch 2 times, most recently from 8126a31 to bae1106 Compare June 10, 2025 10:08
@typicalninja
Copy link
Owner

Release will take longer as my main pc containing lot of changes broke, and i unfortunately do not have a copy of it on my laptop.

@github-actions github-actions bot force-pushed the changeset-release/master branch 18 times, most recently from 9b2fdea to fdf883e Compare July 10, 2025 18:04
@github-actions github-actions bot force-pushed the changeset-release/master branch 2 times, most recently from a8765fe to daaa3bc Compare July 17, 2025 12:18
@github-actions github-actions bot force-pushed the changeset-release/master branch 4 times, most recently from 38a4eb1 to 9ff7cdf Compare July 22, 2025 12:03
@github-actions github-actions bot force-pushed the changeset-release/master branch 22 times, most recently from c8f9b35 to 326ca04 Compare July 29, 2025 14:32
@github-actions github-actions bot force-pushed the changeset-release/master branch from 326ca04 to 555f9ea Compare July 30, 2025 07:24
@typicalninja typicalninja merged commit 0017c70 into master Jul 30, 2025
4 checks passed
@typicalninja typicalninja deleted the changeset-release/master branch July 30, 2025 07:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants